package com.mingtai.design.pattern.behavioralming.state;

/**
 * @description:
 * @author: mingtai
 * @createDate: 0:55 2021/1/11
 * @version: 1.0
 */

public class Test {
    public static void main(String[] args) {
        CourseVideoContext courseVideoContext = new CourseVideoContext();

        // 先设置为播放
        courseVideoContext.setCourseVideoState(new PlayState());

        System.out.println("当前状态: " + courseVideoContext.getCourseVideoState().getClass().getSimpleName());// 获取类名

        // 点个外面,把视频设置为暂停
        courseVideoContext.pause();
        System.out.println("当前状态: " + courseVideoContext.getCourseVideoState().getClass().getSimpleName());

        courseVideoContext.speed();
        System.out.println("当前状态: " + courseVideoContext.getCourseVideoState().getClass().getSimpleName());

        courseVideoContext.stop();
        System.out.println("当前状态: " + courseVideoContext.getCourseVideoState().getClass().getSimpleName());

        courseVideoContext.speed();
    }
}



